package com.demo.cloud.controller;

import com.demo.cloud.service.DemoService;
import com.demo.cloud.vo.UserVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("demo-ribbon")
public class DemoController {

    @Autowired
    private DemoService demoService;

    @GetMapping("hi")
    public String hi(String name) {
        return demoService.hi(name);
    }

    @GetMapping("setName")
    public String setUserName(String name) {
        UserVo vo = new UserVo();
        vo.setName(name);
        return demoService.setUser(vo);
    }
}
